﻿@model iChip.Hotspots.Models.SplashModel
@{
    ViewBag.Title = "Them moi Splash";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}

<!-- BEGIN PAGE HEADER-->
<div class="row">
    <div class="col-md-12">
        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
        <h3 class="page-title">
            Tạo Splash
        </h3>
        <ul class="page-breadcrumb breadcrumb">
            <li>
                <i class="icon-home"></i>
                <a href="/">Home</a>
                <i class="icon-angle-right"></i>
            </li>
            <li><a href="#">AddSplash</a></li>
            <li class="pull-right">
            </li>
        </ul>
        <!-- END PAGE TITLE & BREADCRUMB-->
    </div>
</div>
<!-- END PAGE HEADER-->
<div class="row">
    <div class="col-md-12">
        <div class="tabbable tabbable-custom boxless">
            <div class="tab-content">
                <div class="tab-pane active" id="tab_0">
                    <div class="portlet box green">
                        <div class="portlet-title">
                            <div class="caption">
                                <i class="icon-reorder"></i>
                                @if (Model.Splash_Id > 0)
                                {
                                    <text>Cập nhật Splash</text>
                                }
                                else
                                {
                                    <text>Thêm mới Splash</text>
                                }
                            </div>
                        </div>
                        <div class="portlet-body form">
                            <!-- BEGIN FORM-->
                            @using (Html.BeginForm("AddSplash", "AdminSplashs", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { id = "addsplash_form", @class = "form-horizontal", role = "form" }))
                            {
                                @Html.AntiForgeryToken()
                                @Html.ValidationSummary(true)

                                <div class="form-body">
                                    @Html.TextBoxFor(m => m.Hotspot_Id, new { placeholder = "", @class = "form-control hidden", @readonly = true })
                                    @Html.TextBoxFor(m => m.Splash_Id, new { placeholder = "", @class = "form-control hidden", @readonly = true })
                                    <div class="form-group">
                                        @Html.Label("Hotspot Mac", new { @class = "col-md-3 control-label" })
                                        <div class="col-md-4">
                                            @Html.TextBoxFor(m => m.Hotspot_Mac, new { placeholder = "", @class = "form-control", @readonly = true })
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        @Html.Label("Splash Name", new { @class = "col-md-3 control-label" })
                                        <div class="col-md-4">
                                            @Html.TextBoxFor(m => m.Splash_Name, new { placeholder = "Splash Name", @class = "form-control" })
                                            @Html.ValidationMessageFor(m => m.Splash_Name)
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        @Html.Label("Splash UrlRedirect", new { @class = "col-md-3 control-label" })
                                        <div class="col-md-4">
                                            @Html.TextBoxFor(m => m.Splash_UrlRedirect, new { placeholder = "Splash UrlRedirect", @class = "form-control" })
                                            @Html.ValidationMessageFor(m => m.Splash_UrlRedirect)
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        @Html.Label("Splash StartTime", new { @class = "col-md-3 control-label" })
                                        <div class="col-md-4">
                                            @Html.TextBoxFor(m => m.Splash_StartTime, new { placeholder = "MM/dd/yyyy", @class = "form-control" })
                                            @Html.ValidationMessageFor(m => m.Splash_StartTime)
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        @Html.Label("Splash EndTime", new { @class = "col-md-3 control-label" })
                                        <div class="col-md-4">
                                            @Html.TextBoxFor(m => m.Splash_EndTime, new { placeholder = "MM/dd/yyyy", @class = "form-control" })
                                            @Html.ValidationMessageFor(m => m.Splash_EndTime)
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        @Html.Label("User Type", new { @class = "col-md-3 control-label" })
                                        <div class="col-md-4">
                                            @Html.TextBoxFor(m => m.User_Type, new { @class = "form-control", placeholder = "number" })
                                            @Html.ValidationMessageFor(m => m.User_Type)
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">Splash Content</label>
                                        <div class="col-md-9">
                                            @Html.TextAreaFor(m => m.Splash_Content, new { @row = 20, @class = "ckeditor form-control", name = "editor2" })
                                            @*<textarea class="ckeditor form-control" name="editor2" rows="6" data-error-container="#editor2_error"></textarea>
                                                <div id="editor2_error"></div>*@
                                        </div>
                                    </div>
                                </div>
                                <div class="form-actions fluid">
                                    <div class="col-md-offset-3 col-md-9">
                                        @if (Model.Splash_Id > 0)
                                        {
                                            <input type="submit" value="Cập nhật" class="btn green" />
                                        }
                                        else
                                        {
                                            <input type="submit" value="Thêm mới" class="btn blue" />
                                        }
                                        <a href="@ViewBag.ReturnUrl" title="Hủy" class="btn default">Hủy</a>
                                    </div>
                                </div>
                            }
                            <!-- END FORM-->
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
    <script type="text/javascript" src="/AssetsAdmin/plugins/ckeditor/ckeditor.js"></script>
    <script>
        function goBack() {
            window.location.href = "/@ViewBag.ReturnUrl";
        }
    </script>
}
